import request from '@/utils/request'

export interface userinfoModel {
  cellular: string,
  uuid: string,
  token: string,
  regOrLogChoice: string
}

export interface BankCardModel {
  accBkId: string,
  accBkName: string,
  accBkNo: string,
  accBkSelect: string,
}

export interface BankInfoModel {
  autoPopulation: string,
  bankProminenceIndex: string,
  bkcode: string,
  bkname: string,
  hotFlag: string,
  sort: string,
}

export interface DeferInfoModel {
  "repayRecordSet": {
    "miscFeeCollect": string,
    "loanTenure": string,
    "repayAmt": string,
    "repayDate": string
  },
  "computedSet": {
    "handlingFee": string,
    "delayedFee": string,
    "creditPaymentDue": string,
    "rolloverCharge": string,
    "financeCharge": string,
    "salesTax": string
  }

}

export interface ReserveItemModel {
  reserveLogo: string,
  reserveName: string,
  reserveAmt: string,
  reserveTime: string,
  reserveId: string,
}

export interface ReserveDataModel {
  reserveList: ReserveItemModel[],
  reserveTips: string
}

//   interface tokenModel {
//     token: string
//   }

//   interface loginModel {
//     username: string,
//     password: string
//   }


const addSomeParams = (data: any) => {
  data.reqSource = 'ios';
  data.webVersion = 'H5';
  data.ownerShip = import.meta.env.VITE_OWNERSHIP,
  // data.ownerShip = 'cashline_ios',
    data.i18n = 'hi_IN'
}

export default {



  checkedIsOldCustomer(data: any) {
    addSomeParams(data)
    // return request.post<any,any>('/hrktdowmr/cOMpChS/mgfwdiyXKh/isReturningCustomer',data:JSON.stringify(data))
    return request({
      method: 'post',
      url: '/hrktdowmr/cOMpChS/mgfwdiyXKh/isReturningCustomer',
      data: data,
      headers: {
        'Content-Type': 'application/json',
      },
    })
  },


  getSMSCode(data: any) {
    addSomeParams(data)
    return request({
      method: 'post',
      url: '/Ihdrm/rONUJ/LORg/VRrz',
      data: data,
      headers: {
        'Content-Type': 'application/json',
      },
    })
  },




  login(data: any) {
    addSomeParams(data)
    return request({
      method: 'post',
      url: '/hrktdowmr/cOMpChS/ABdSCJ/sm8YTnDzx',
      data: data,
      headers: {
        'Content-Type': 'application/json',
      },
    })
  },


  getHomeScreen(data: any) {
    addSomeParams(data)
    return request({
      method: 'post',
      url: '/DQjSJRd/nIQk/ArDhaI/ArDhaIData',
      data: data,
      headers: {
        'Content-Type': 'application/json',
      },
    })
  },


  getOrderDetail(data: any) {
    addSomeParams(data)
    return request({
      method: 'post',
      url: '/hrktdowmr/cOMpChS/ABdSCJ/ncndUIg',
      data: data,
      headers: {
        'Content-Type': 'application/json',
      },
    })
  },


  checkRepayStatus(data: any) {
    addSomeParams(data)
    return request({
      method: 'post',
      url: '/hrktdowmr/cOMpChS/Lwpaod/KhVVQOP',
      data: data,
      headers: {
        'Content-Type': 'application/json',
      },
    })
  },


  applyToRePayMent(data: any) {
    addSomeParams(data)
    return request({
      method: 'post',
      url: '/hrktdowmr/cOMpChS/Lwpaod/buFN',
      data: data,
      headers: {
        'Content-Type': 'application/json',
      },
    })
  },


  getDictionary(data: any) {
    addSomeParams(data)
    return request({
      method: 'post',
      url: '/Ihdrm/rONUJ/XvmBCCW',
      data: data,
      headers: {
        'Content-Type': 'application/json',
      },
    })
  },


  callRiskControlRules(data: any) {
    addSomeParams(data)
    return request({
      method: 'post',
      url: '/DQjSJRd/nIQk/aTXdyJPd/vxHuX',
      data: data,
      headers: {
        'Content-Type': 'application/json',
      },
    })
  },

  getRiskResult(data: any) {
    addSomeParams(data)
    return request({
      method: 'post',
      url: '/DQjSJRd/nIQk/aTXdyJPd/wjWTRWGiUwy',
      data: data,
      headers: {
        'Content-Type': 'application/json',
      },
    })
  },

  getLoanCalculationInfo(data: any) {
    addSomeParams(data)
    return request({
      method: 'post',
      url: '/DQjSJRd/nIQk/iOUXFoy/hWTw',
      data: data,
      headers: {
        'Content-Type': 'application/json',
      },
    })
  },


  confirmLoanHandler(data: any) {
    addSomeParams(data)
    return request({
      method: 'post',
      url: '/DQjSJRd/nIQk/iOUXFoy/SuSO',
      data: data,
      headers: {
        'Content-Type': 'application/json',
      },
    })
  },


  deferCalculation(data: any) {
    addSomeParams(data)
    return request({
      method: 'post',
      url: '/hrktdowmr/cOMpChS/gUeV/txBrsm',
      data: data,
      headers: {
        'Content-Type': 'application/json',
      },
    })
  },

  applyForDefer(data: any) {
    addSomeParams(data)
    return request({
      method: 'post',
      url: '/hrktdowmr/cOMpChS/gUeV/GHAF',
      data: data,
      headers: {
        'Content-Type': 'application/json',
      },
    })
  },


  logout(data: any) {
    addSomeParams(data)
    return request({
      method: 'post',
      url: '/hrktdowmr/cOMpChS/ABdSCJ/jpjFuSvM',
      data: data,
      headers: {
        'Content-Type': 'application/json',
      },
    })
  },


  getBankCardListData(data: any) {
    addSomeParams(data)
    return request({
      method: 'post',
      url: '/DQjSJRd/nIQk/WtLfNv/pnaBYVMFNj',
      data: data,
      headers: {
        'Content-Type': 'application/json',
      },
    })
  },


  saveSelectedDefaultBanCard(data: any) {
    addSomeParams(data)
    return request({
      method: 'post',
      url: '/DQjSJRd/nIQk/WtLfNv/LqMtk',
      data: data,
      headers: {
        'Content-Type': 'application/json',
      },
    })
  },


  gteBankInfoList(data: any) {
    addSomeParams(data)
    return request({
      method: 'post',
      url: '/Ihdrm/rONUJ/FaPlboSUPXS/VpbK',
      data: data,
      headers: {
        'Content-Type': 'application/json',
      },
    })
  },


  submitBankCardInfo(data: any) {
    addSomeParams(data)
    return request({
      method: 'post',
      url: '/DQjSJRd/nIQk/xQoKqDtBr/gimTtvjvXO',
      data: data,
      headers: {
        'Content-Type': 'application/json',
      },
    })
  },

  getReserveOrderList(data: any) {
    addSomeParams(data)
    return request({
      method: 'post',
      url: '/DQjSJRd/nIQk/wxXrInpW/obSQWkWr',
      data: data,
      headers: {
        'Content-Type': 'application/json',
      },
    })
  },

  cancelReserveOrder(data: any) {
    addSomeParams(data)
    return request({
      method: 'post',
      url: '/DQjSJRd/nIQk/wxXrInpW/bzSyMMNcmkUS',
      data: data,
      headers: {
        'Content-Type': 'application/json',
      },
    })
  },
  
  // changeCircularInfo
  changeCircularInfo(data:any){
    addSomeParams(data)
    return request({
      method: 'post',
      url: '/DQjSJRd/nIQk/bvoK/gbnNPmpYprf',
      data: data,
      headers: {
        'Content-Type': 'application/json',
      },
    })
  }



  //

  // login(data:loginModel){
  //     // return request.post<any,tokenModel>(`/admin/acl/index/login`,data)
  //     return request({

  //     })
  // },
  // 
  // info(){
  //     return request.get<any,userinfoModel>(`/admin/acl/index/info`)
  // },
  // 
  // logout(){
  //     return request.post<any,null>(`/admin/acl/index/logout`)
  // }
}
